﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="NEWUpdateData.aspx.cs" Inherits="mpsalaryprojectgroup.NEWUpdateData" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Welcome to the PGS Portal</title>
    <style type="text/css">
        .style1
        {
            color: #FF9933;
        }
        .style2
        {
            color: #663300;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <meta charset="utf-8" />

	<!-- Set the viewport width to device width for mobile -->
	<meta name="viewport" content="initial-scale=1, maximum-scale=1" />

	<title>Welcome to the PGS Portal</title>
  
	<!-- Included CSS Files -->
	<link rel="stylesheet" href="CSS\foundation.css">
	<link rel="stylesheet" href="CSS\app.css">
    <link rel="stylesheet" href="CSS\ie.css">


	<!-- IE Fix for HTML5 Tags -->
	<!--[if lt IE 9]>
		<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
	<![endif]-->

           <!--Navigation tab part 2 -->
<script>
    // Javascript originally by Patrick Griffiths and Dan Webb.
    // http://htmldog.com/articles/suckerfish/dropdowns/
    sfHover = function () {
        var sfEls = document.getElementById("navbar").getElementsByTagName("li");
        for (var i = 0; i < sfEls.length; i++) {
            sfEls[i].onmouseover = function () {
                this.className += " hover";
            }
            sfEls[i].onmouseout = function () {
                this.className = this.className.replace(new RegExp(" hover\\b"), "");
            }
        }
    }
    if (window.attachEvent) window.attachEvent("onload", sfHover);
</script>
    
    <%--<link rel="stylesheet" href="CSS\Tab1.css">--%>

    <div class="container">
		<div class="row">
			<div class="twelve columns" align="center">
				<h2><img alt="" src="Images/orangesample%20copy.jpg" /></h2>
			</div>
		</div>

    <div class="row">
        <!--for navigation tab-->
        <%--<ul id="button">

         <li><a href="#">Home</a></li>
         <li><a href="#">About</a></li>
         <li><a href="#">Services</a></li>
         <li><a href="#">Clients</a></li>
         <li><a href="#">Products</a></li>
         <li><a href="#">F.A.Q</a></li>
         <li><a href="#">Contact Us</a></li>
         <li><a href="/NEWMainPage.aspx">Sign Out</a></li>
           </ul>--%>


        <!--Navigation part 2-->
		<ul id="navbar">
			<li><a href="NEWAdminUploadResult.aspx">Home</a>
            <!-- put link to link back to homepage -->
			</li>
			<li><a href="NEWUpdateData.aspx">Edit</a>			
			</li>
                <%--<li><a href="/NEWAnalytical.aspx">Analytical</a>
                <ul>
                    <li><a href="/NEWAnalytical.aspx">Analyse</a></li>
                    <li><a href="/NEWNEWReport.aspx">Report</a></li>
                </ul>
            </li>--%>
			<%--<li><a href="/NEWAdminContactUs.aspx">Contact Us</a>
				<!--put contact details plus google map-->		
			</li>--%>
			<li><a href="NEWAdminDelete.aspx">Delete Users</a>	
                <ul>
				</ul>            	
			</li>

            <li><a href="NEWMainPage.aspx">Logout</a>	
                <ul>
                </ul>        	
			</li>

		</ul>
</div>

 <div class="row">
        <div class="twelve columns">
            Dear
            <asp:Label ID="lblUsername" runat="server" Font-Bold="True"></asp:Label>
            ,</div>
    </div>
    
  <div class="row">
        <div class="twelve columns" align="center">
            <h3 class="style1">Update Latest/Past Year Results</h3>
        </div>
    </div>
    <div class="row">
        <div class="four columns">
            <span class="style2">Choose a year to edit:</span><br />
            <asp:DropDownList ID="ddlYear" runat="server" AutoPostBack="True">
                <asp:ListItem></asp:ListItem>
                <asp:ListItem>2007</asp:ListItem>
                <asp:ListItem>2008</asp:ListItem>
                <asp:ListItem>2009</asp:ListItem>
                <asp:ListItem>2010</asp:ListItem>
            </asp:DropDownList>
        </div>

        <div class="four columns">
        </div>

        <div class="four columns">
            &nbsp;</div>
    </div>
    

    <div class="row">
        <div class="twelve columns">
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
                DataKeyNames="Year,Course" DataSourceID="SqlDataSource1" 
                AllowPaging="True" Font-Size="XX-Small" BackColor="LightGoldenrodYellow" 
                BorderColor="Tan" BorderWidth="1px" CellPadding="2" ForeColor="Black" 
                GridLines="None" ShowFooter="True" >
                <AlternatingRowStyle BackColor="PaleGoldenrod" />
                <Columns>
                    <asp:CommandField ShowEditButton="True" />
                    <asp:BoundField DataField="Year" HeaderText="Year" ReadOnly="True" 
                        SortExpression="Year" />
                    <asp:BoundField DataField="Course" HeaderText="Course" ReadOnly="True" 
                        SortExpression="Course" />
                    <asp:BoundField DataField="PolyConducting" HeaderText="Poly Conducting" 
                        SortExpression="PolyConducting" />
                    <asp:BoundField DataField="FreshGradsEmpNum" HeaderText="Fresh Grads Emp Num" 
                        SortExpression="FreshGradsEmpNum" />
                    <asp:BoundField DataField="FreshGradsEmpRate" HeaderText="Fresh Grads Emp Rate" 
                        SortExpression="FreshGradsEmpRate" />
                    <asp:BoundField DataField="FreshGradsMonthlyMean" 
                        HeaderText="Fresh Grads Monthly Mean" 
                        SortExpression="FreshGradsMonthlyMean" />
                    <asp:BoundField DataField="FreshGradsMonthlyMedian" 
                        HeaderText="Fresh Grads Monthly Median" 
                        SortExpression="FreshGradsMonthlyMedian" />
                    <asp:BoundField DataField="PostGradsEmpNum" HeaderText="Post Grads Emp Num" 
                        SortExpression="PostGradsEmpNum" />
                    <asp:BoundField DataField="PostGradsEmpRate" HeaderText="Post Grads Emp Rate" 
                        SortExpression="PostGradsEmpRate" />
                    <asp:BoundField DataField="PostGradsMonthlyMean" 
                        HeaderText="Post Grads Monthly Mean" 
                        SortExpression="PostGradsMonthlyMean" />
                    <asp:BoundField DataField="PostGradsMonthlyMedian" 
                        HeaderText="Post Grads Monthly Median" 
                        SortExpression="PostGradsMonthlyMedian" />
                    <asp:BoundField DataField="IsIndustrial" HeaderText="Is Industrial" 
                        SortExpression="IsIndustrial" />
                </Columns>
                <FooterStyle BackColor="Tan" />
                <HeaderStyle BackColor="Tan" Font-Bold="True" />
                <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" 
                    HorizontalAlign="Center" />
                <SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
                <SortedAscendingCellStyle BackColor="#FAFAE7" />
                <SortedAscendingHeaderStyle BackColor="#DAC09E" />
                <SortedDescendingCellStyle BackColor="#E1DB9C" />
                <SortedDescendingHeaderStyle BackColor="#C2A47B" />
            </asp:GridView>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConflictDetection="CompareAllValues" 
                ConnectionString="<%$ ConnectionStrings:dbConn %>" 
                DeleteCommand="DELETE FROM [Wages] WHERE [Year] = @original_Year AND [Course] = @original_Course AND (([PolyConducting] = @original_PolyConducting) OR ([PolyConducting] IS NULL AND @original_PolyConducting IS NULL)) AND (([FreshGradsEmpNum] = @original_FreshGradsEmpNum) OR ([FreshGradsEmpNum] IS NULL AND @original_FreshGradsEmpNum IS NULL)) AND (([FreshGradsEmpRate] = @original_FreshGradsEmpRate) OR ([FreshGradsEmpRate] IS NULL AND @original_FreshGradsEmpRate IS NULL)) AND (([FreshGradsMonthlyMean] = @original_FreshGradsMonthlyMean) OR ([FreshGradsMonthlyMean] IS NULL AND @original_FreshGradsMonthlyMean IS NULL)) AND (([FreshGradsMonthlyMedian] = @original_FreshGradsMonthlyMedian) OR ([FreshGradsMonthlyMedian] IS NULL AND @original_FreshGradsMonthlyMedian IS NULL)) AND (([PostGradsEmpNum] = @original_PostGradsEmpNum) OR ([PostGradsEmpNum] IS NULL AND @original_PostGradsEmpNum IS NULL)) AND (([PostGradsEmpRate] = @original_PostGradsEmpRate) OR ([PostGradsEmpRate] IS NULL AND @original_PostGradsEmpRate IS NULL)) AND (([PostGradsMonthlyMean] = @original_PostGradsMonthlyMean) OR ([PostGradsMonthlyMean] IS NULL AND @original_PostGradsMonthlyMean IS NULL)) AND (([PostGradsMonthlyMedian] = @original_PostGradsMonthlyMedian) OR ([PostGradsMonthlyMedian] IS NULL AND @original_PostGradsMonthlyMedian IS NULL)) AND (([IsIndustrial] = @original_IsIndustrial) OR ([IsIndustrial] IS NULL AND @original_IsIndustrial IS NULL))" 
                InsertCommand="INSERT INTO [Wages] ([Year], [Course], [PolyConducting], [FreshGradsEmpNum], [FreshGradsEmpRate], [FreshGradsMonthlyMean], [FreshGradsMonthlyMedian], [PostGradsEmpNum], [PostGradsEmpRate], [PostGradsMonthlyMean], [PostGradsMonthlyMedian], [IsIndustrial]) VALUES (@Year, @Course, @PolyConducting, @FreshGradsEmpNum, @FreshGradsEmpRate, @FreshGradsMonthlyMean, @FreshGradsMonthlyMedian, @PostGradsEmpNum, @PostGradsEmpRate, @PostGradsMonthlyMean, @PostGradsMonthlyMedian, @IsIndustrial)" 
                OldValuesParameterFormatString="original_{0}" 
                SelectCommand="SELECT * FROM [Wages] WHERE ([Year] = @Year2)" 
                UpdateCommand="UPDATE [Wages] SET [PolyConducting] = @PolyConducting, [FreshGradsEmpNum] = @FreshGradsEmpNum, [FreshGradsEmpRate] = @FreshGradsEmpRate, [FreshGradsMonthlyMean] = @FreshGradsMonthlyMean, [FreshGradsMonthlyMedian] = @FreshGradsMonthlyMedian, [PostGradsEmpNum] = @PostGradsEmpNum, [PostGradsEmpRate] = @PostGradsEmpRate, [PostGradsMonthlyMean] = @PostGradsMonthlyMean, [PostGradsMonthlyMedian] = @PostGradsMonthlyMedian, [IsIndustrial] = @IsIndustrial WHERE [Year] = @original_Year AND [Course] = @original_Course AND (([PolyConducting] = @original_PolyConducting) OR ([PolyConducting] IS NULL AND @original_PolyConducting IS NULL)) AND (([FreshGradsEmpNum] = @original_FreshGradsEmpNum) OR ([FreshGradsEmpNum] IS NULL AND @original_FreshGradsEmpNum IS NULL)) AND (([FreshGradsEmpRate] = @original_FreshGradsEmpRate) OR ([FreshGradsEmpRate] IS NULL AND @original_FreshGradsEmpRate IS NULL)) AND (([FreshGradsMonthlyMean] = @original_FreshGradsMonthlyMean) OR ([FreshGradsMonthlyMean] IS NULL AND @original_FreshGradsMonthlyMean IS NULL)) AND (([FreshGradsMonthlyMedian] = @original_FreshGradsMonthlyMedian) OR ([FreshGradsMonthlyMedian] IS NULL AND @original_FreshGradsMonthlyMedian IS NULL)) AND (([PostGradsEmpNum] = @original_PostGradsEmpNum) OR ([PostGradsEmpNum] IS NULL AND @original_PostGradsEmpNum IS NULL)) AND (([PostGradsEmpRate] = @original_PostGradsEmpRate) OR ([PostGradsEmpRate] IS NULL AND @original_PostGradsEmpRate IS NULL)) AND (([PostGradsMonthlyMean] = @original_PostGradsMonthlyMean) OR ([PostGradsMonthlyMean] IS NULL AND @original_PostGradsMonthlyMean IS NULL)) AND (([PostGradsMonthlyMedian] = @original_PostGradsMonthlyMedian) OR ([PostGradsMonthlyMedian] IS NULL AND @original_PostGradsMonthlyMedian IS NULL)) AND (([IsIndustrial] = @original_IsIndustrial) OR ([IsIndustrial] IS NULL AND @original_IsIndustrial IS NULL))">
                <DeleteParameters>
                    <asp:Parameter Name="original_Year" Type="String" />
                    <asp:Parameter Name="original_Course" Type="String" />
                    <asp:Parameter Name="original_PolyConducting" Type="String" />
                    <asp:Parameter Name="original_FreshGradsEmpNum" Type="String" />
                    <asp:Parameter Name="original_FreshGradsEmpRate" Type="String" />
                    <asp:Parameter Name="original_FreshGradsMonthlyMean" Type="String" />
                    <asp:Parameter Name="original_FreshGradsMonthlyMedian" Type="String" />
                    <asp:Parameter Name="original_PostGradsEmpNum" Type="String" />
                    <asp:Parameter Name="original_PostGradsEmpRate" Type="String" />
                    <asp:Parameter Name="original_PostGradsMonthlyMean" Type="String" />
                    <asp:Parameter Name="original_PostGradsMonthlyMedian" Type="String" />
                    <asp:Parameter Name="original_IsIndustrial" Type="String" />
                </DeleteParameters>
                <InsertParameters>
                    <asp:Parameter Name="Year" Type="String" />
                    <asp:Parameter Name="Course" Type="String" />
                    <asp:Parameter Name="PolyConducting" Type="String" />
                    <asp:Parameter Name="FreshGradsEmpNum" Type="String" />
                    <asp:Parameter Name="FreshGradsEmpRate" Type="String" />
                    <asp:Parameter Name="FreshGradsMonthlyMean" Type="String" />
                    <asp:Parameter Name="FreshGradsMonthlyMedian" Type="String" />
                    <asp:Parameter Name="PostGradsEmpNum" Type="String" />
                    <asp:Parameter Name="PostGradsEmpRate" Type="String" />
                    <asp:Parameter Name="PostGradsMonthlyMean" Type="String" />
                    <asp:Parameter Name="PostGradsMonthlyMedian" Type="String" />
                    <asp:Parameter Name="IsIndustrial" Type="String" />
                </InsertParameters>
                <SelectParameters>
                    <asp:ControlParameter ControlID="ddlYear" Name="Year2" 
                        PropertyName="SelectedValue" Type="String" />
                </SelectParameters>
                <UpdateParameters>
                    <asp:Parameter Name="PolyConducting" Type="String" />
                    <asp:Parameter Name="FreshGradsEmpNum" Type="String" />
                    <asp:Parameter Name="FreshGradsEmpRate" Type="String" />
                    <asp:Parameter Name="FreshGradsMonthlyMean" Type="String" />
                    <asp:Parameter Name="FreshGradsMonthlyMedian" Type="String" />
                    <asp:Parameter Name="PostGradsEmpNum" Type="String" />
                    <asp:Parameter Name="PostGradsEmpRate" Type="String" />
                    <asp:Parameter Name="PostGradsMonthlyMean" Type="String" />
                    <asp:Parameter Name="PostGradsMonthlyMedian" Type="String" />
                    <asp:Parameter Name="IsIndustrial" Type="String" />
                    <asp:Parameter Name="original_Year" Type="String" />
                    <asp:Parameter Name="original_Course" Type="String" />
                    <asp:Parameter Name="original_PolyConducting" Type="String" />
                    <asp:Parameter Name="original_FreshGradsEmpNum" Type="String" />
                    <asp:Parameter Name="original_FreshGradsEmpRate" Type="String" />
                    <asp:Parameter Name="original_FreshGradsMonthlyMean" Type="String" />
                    <asp:Parameter Name="original_FreshGradsMonthlyMedian" Type="String" />
                    <asp:Parameter Name="original_PostGradsEmpNum" Type="String" />
                    <asp:Parameter Name="original_PostGradsEmpRate" Type="String" />
                    <asp:Parameter Name="original_PostGradsMonthlyMean" Type="String" />
                    <asp:Parameter Name="original_PostGradsMonthlyMedian" Type="String" />
                    <asp:Parameter Name="original_IsIndustrial" Type="String" />
                </UpdateParameters>
            </asp:SqlDataSource>
        </div>
    </div>


    <div class="row">
        <div class="twelve columns" align="center">
        <br />
        <br />
        <br />
            <asp:Image ID="Image1" runat="server" ImageUrl="~/Images/school.JPG" />
            <div class="six column"></div>
        </div>
    </div>
    

    

    <!-- Included JS Files -->
	<script src="javascripts/foundation.js"></script>
	<script src="javascripts/app.js"></script>

    </form>
</body>
</html>
